package system

import (
	"cubeAdmin/common/jwtauth"
	"cubeAdmin/controllers"
)

type HomeController struct {
	controllers.BaseController
}

func (c *HomeController) Index() {
	c.Data["pageTitle"] = "系统首页"
	user, err := jwtauth.GetAdminDetailUser(c.Ctx.Input)
	if err != nil {
		c.Redirect("/login", 302)
		c.StopRun()
	}
	c.Data["user"] = user
	c.TplName = "index.tpl"
}

// Console 首页统计页面
func (c *HomeController) Console() {
	c.Data["pageTitle"] = "系统首页"
	c.TplName = "console/console.tpl"
}
